import  type {MutationTree,ActionTree,GetterTree}  from 'vuex'
import  type  {State}  from '../index'

export  interface ControlState{
  leftCollapseStatus:boolean,
  rightCollapseStatus:boolean
}


let state:ControlState = {
  leftCollapseStatus : true,
  rightCollapseStatus : true,
};

let getters:GetterTree<ControlState,State> = {
  
};
let mutations:MutationTree<ControlState> = {
   //更新面板展示状态
   updateCollapseStatus(newState, {type,value}) {
    if(type==='left'){
      newState.leftCollapseStatus = value
    }else{
      newState.rightCollapseStatus = value
    }
  },
  //重置数据
  resetState(newState){
    newState.leftCollapseStatus =  true
    newState.rightCollapseStatus =  true
  }
};
let actions:ActionTree<ControlState,State> = {

};
export default {
  namespaced: true,//开始模块命名空间
  state,
  getters,
  mutations,
  actions,
};
